package pl.puntin.punclient.messages;

public final class RoomListMessage extends Message {
	public final String[] roomList;
	public final String[] roomPlayers;
	@Override
	public byte getType() {
		return MessageTypes.S_ADD_ROOM_OK;
	}
	
	public RoomListMessage(final byte[] rawMessage)
	{
		char[] messageText = new char[rawMessage.length-1];
		for (int i = 1; i < rawMessage.length; i++)
		{
			messageText[i-1]=(char)rawMessage[i];
		}
		String stream = new String(messageText);
		String[] tmp = stream.split("#");
		roomList = new String[tmp.length/2];
		roomPlayers = new String[tmp.length/2];
		for(int i = 0; i< tmp.length; i++)
		{
			if(i%2 == 0)
				roomList[i/2] = tmp[i];
			if(i%2 == 1)
				roomList[i/2] = tmp[i];
		}
	}
	@Override
	public byte[] getByteForm() {
		
		return null;
	}

}
